#ifndef __LIB_SUBT_H__
#define __LIB_SUBT_H__

#include <sys_config.h>
#include <basic_types.h>

#define LIBSUBT_PRINTF(...) 	do{}while(0)
//#define LIBSUBT_PRINTF 		libc_printf
typedef enum
{
    DVB_SUBT,
    ATSC_SUBT
}SUBT_TYPE;

struct t_subt_lang 
{
	//UINT8 lang_idx;
	UINT16 pid;
	UINT8 subt_type;
	UINT16 com_page;
	UINT16 anci_page;
	UINT8 lang[3];
};

enum subt_event
{
	SUBT_PID_UPDATE = 1,
	SUBT_PID_ADD = 3,		// Add for SAT>IP Client
};

//vicky20110322  buffer address for section data receiver, send to lib_subt_atsc_stream_identify() as 2nd para (Dual CPU Case)
struct atsc_subt_config_par
{
   UINT8 *bs_buf_addr;
   UINT16 bs_buf_len;
   UINT8 *sec_buf_addr;
   UINT16 sec_buf_len;
   UINT8 Outline_thickness_from_stream;
   UINT8 DropShadow_right_from_stream;   
   UINT8 DropShadow_bottom_from_stream;      
   UINT8 Outline_thickness;
   UINT8 DropShadow_right;
   UINT8 DropShadow_bottom;   
};
typedef void (*SUBT_EVENT_CALLBACK)(enum subt_event event, UINT32 param);

#ifndef DVB_SUBT_MAX_CNT
#define DVB_SUBT_MAX_CNT	10
#endif

#define SUBTITLE_LANG_NUM 10	//reserve for pvr

INT32 subt_descriptor(UINT8 tag, INT32 desc_length, UINT8 *desc, void *param);
UINT32 subt_get_language(struct t_subt_lang** list ,UINT8* num);
UINT8 subt_get_cur_language(void);
INT32 subt_set_language(UINT8 lang);
INT32 subt_enable(BOOL);
void subt_pvr_set_language(struct t_subt_lang* list ,UINT8 num);
INT32 subt_pvr_enable(BOOL enable,UINT16 dmx_id);

INT32 subt_show_onoff(BOOL bOn);
INT32 subt_register(UINT32 monitor_id);
INT32 subt_unregister(UINT32 monitor_id);

void subt_reg_callback(SUBT_EVENT_CALLBACK callback);
void subt_unreg_callback();
BOOL subt_is_available();

#endif /*__LIB_SUBT_H__  */
